package com.longxi.tianjintianbao.ui.adapter.multitype.maintain;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.model.maintain.Maintain;
import com.longxi.tianjintianbao.model.maintain.MaintainDetailed;

import me.drakeet.multitype.ItemViewBinder;

/**
 * Created by cxw on 2018/2/20.
 */
public class MaintainDetailedViewBinder extends ItemViewBinder<MaintainDetailed, MaintainDetailedViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_maintain_detailed, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull MaintainDetailed maintainDetailed) {
        holder.mTvStandard.setText("保养标准:" + maintainDetailed.getStandard());
        holder.mTvContent.setText("保养内容:" + maintainDetailed.getContent());
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        TextView mTvStandard;
        TextView mTvContent;

        ViewHolder(View itemView) {
            super(itemView);
            mTvStandard = itemView.findViewById(R.id.tvStandard);
            mTvContent = itemView.findViewById(R.id.tvContent);
        }
    }
}
